import requests
from bs4 import BeautifulSoup
import re

for page in range(1, 1 + 1):
    url = f"https://book.zongheng.com/store/c0/c0/b0/u4/p{page}/v0/s9/t0/u0/i1/ALL.html"
    response = requests.get(url)
    html_str = response.content.decode()
    root = BeautifulSoup(html_str, "lxml")
    print(dir(root))
    book_list = root.select("div[class='bookinfo']")
    for book in book_list:
        book_name = book.select_one(".bookname>a").text
        book_url = book.select_one(".bookname>a")["href"]
        author, category = [tag.text for tag in book.select(".bookilnk>a")]
        print(book_name, book_url, author, category)
